<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="path" value="${pageContext.request.contextPath }"/>
<html>
<head>
    <meta charset="utf-8">
    <title>水印设置</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="./lib/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="./css/index.css" media="all">
</head>
<body>
<div class="x-body layui-card">
    <div class="layui-tab layui-tab-brief">
        <div class="x-nav">
          <span class="layui-breadcrumb">
            <a href="">系统设置</a>
            <a href="">系统设置</a>
            <a>
              <cite>水印设置</cite></a>
          </span>
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
                <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
        </div>
        <div class="layui-col-md12">
            <form class="layui-form layui-form-pane" action="" id="frm-reg" style="background: #fff;padding: 10px">
                <div class="layui-form-item" pane="">
                    <label class="layui-form-label">开启水印</label>
                    <div class="layui-input-block">
                        <input type="radio" name="status" value="0" title="开启" checked="checked">
                        <input type="radio" name="status" value="1" title="关闭">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">水印位置</label>
                    <div class="layui-input-block">
                        <select name="position" id="position" lay-filter="position">
                            <option value="1">顶部居左水印</option>
                            <option value="2">顶部居中水印</option>
                            <option value="3">顶部居右水印</option>
                            <option value="4">左居中水印</option>
                            <option value="5">居中水印</option>
                            <option value="6">右居中水印</option>
                            <option value="7">底部居左水印</option>
                            <option value="8">底部居中水印</option>
                            <option value="9">底部居右水印</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">水印透明度</label>
                    <div class="layui-input-block">
                        <input type="number" min="0" max="100" name="pellucidity" id="pellucidity" value="0" placeholder="请输入水印透明度" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item" pane="">
                    <label class="layui-form-label">水印类型</label>
                    <div class="layui-input-block">
                        <input type="radio" name="type" value="0" title="图片水印" lay-filter="filter" checked="checked">
                        <input type="radio" name="type" value="1" title="文字水印" lay-filter="filter">
                    </div>
                </div>
                <div class="layui-form-item watermark_images">
                    <label class="layui-form-label">水印图片</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" name="images" id="images" value="">
                    </div>
                    <div class="layui-form-mid layui-word-aux"><button type="button" class="layui-btn" data-name="images" data-place="system" id="upload_pictures" style="margin-top: -8px;">上传图片</button></div>
                </div>
                <div class="layui-form-item watermark_images">
                    <div class="layui-input-block">
                        <img id="images_url" src="images/default.png" style="width: 120px;height: 50px;border: 1px solid #ccc;position: absolute;top: -8px;border-radius: 5px;">
                    </div>
                    <div class="layui-progress layui-progress-big" lay-showpercent="true" lay-filter="layui_progress" style="width: 30%;margin-top: 15px;">
                        <div class="layui-progress-bar layui-bg-normal" lay-percent="0%"></div>
                    </div>
                </div>
                <div class="layui-form-item watermark_font">
                    <label class="layui-form-label">水印文字</label>
                    <div class="layui-input-block">
                        <input type="text" name="font" id="font" value="水印文字" placeholder="请输入水印文字" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item watermark_font">
                    <label class="layui-form-label">文字字号</label>
                    <div class="layui-input-block">
                        <input type="number" min="0" max="100" name="font_size" id="font_size" value="0" placeholder="请输入文字字号" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item watermark_font">
                    <label class="layui-form-label">文字颜色</label>
                    <div class="layui-input-inline" style="width: 120px;">
                        <input type="text" name="font_color" id="font-color-input" value="#1c97f5" placeholder="请选择颜色" class="layui-input" >
                    </div>
                    <div class="layui-inline" style="margin-top: 0px;">
                        <div id="font-color"></div>
                    </div>
                </div>
                <div class="layui-form-item watermark_font">
                    <label class="layui-form-label">文字偏移量</label>
                    <div class="layui-input-block">
                        <input type="number" min="0" max="100" name="font_offset" id="font_offset" value="0" placeholder="请输入文字偏移量" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item watermark_font">
                    <label class="layui-form-label">倾斜角度</label>
                    <div class="layui-input-block">
                        <input type="number" min="0" max="100" name="font_tilt" id="font_tilt" value="0" placeholder="请输入文字倾斜角度" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item" style="margin-left: 50px;">
                    <input type="hidden" name="request_url" id="request_url" value="">
                    <input type="hidden" name="types" id="types" value="0">
                    <button class="layui-btn" id="execute" lay-submit="execute" lay-filter="execute"><i class="layui-icon layui-icon-form"></i>保存</button>
                </div>
            </form>
        </div>
    </div>

</div>
</body>
</html>
<script src="./js/jquery.min.js"></script>
<script src="./lib/layui/layui.js"></script>
<script src="./js/index.js"></script>
<script>
    $('.watermark_font').hide();
    layui.use('form', function () {
        var form = layui.form;
        form.on('radio(filter)', function(data){
            var id = data.value
            if(id == 0){
                $('.watermark_images').show();
                $('.watermark_font').hide();
            }else{
                $('.watermark_images').hide();
                $('.watermark_font').show();
            }
        });
    });
</script>